package com.qyer.search.report;

import com.qyer.search.model.SearchParameter;
import com.qyer.search.model.SearchParameterOrigin;
import com.qyer.search.model.result.SearchPackage;

import java.util.List;

/**
 * User: Z J Wu Date: 2016/01/07 Time: 20:40 Package: com.qyer.search.report
 */
public class SearchReportItem {

  private SearchParameterOrigin searchParameterOrigin;

  private List<? extends SearchPackage> resultPackages;

  private SearchReportItem() {
  }

  public SearchReportItem(SearchParameterOrigin searchParameter,
                          List<? extends SearchPackage> resultPackages) {
    this.searchParameterOrigin = searchParameter;
    this.resultPackages = resultPackages;
  }

  public static SearchReportItem createPill() {
    return new SearchReportItem();
  }

  public boolean isPill() {
    return this.searchParameterOrigin == null && this.resultPackages == null;
  }

  public SearchParameterOrigin getSearchParameter() {
    return searchParameterOrigin;
  }

  public List<? extends SearchPackage> getResultPackages() {
    return resultPackages;
  }
}
